<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:constants="http://www.tuanzi.com/constants/tags"
                template="/templates/template.xhtml">

    <ui:define name="title">产品信息</ui:define>
    <ui:define name="content">
        <h:form id="incomeForm">
            <div class="topbar clearfix"
                 style="background: -webkit-linear-gradient(top,#f6f7f9 0,#ebedf0 100%);">
                <p:toolbar>
                    <f:facet name="right">
                        <p:commandButton value="编辑" icon="fa fa-edit"
                                         actionListener="#{xhhSettlementProductInfoBean.changeStatusToEdit}"
                                         process="@this"
                                         update="@form" rendered="#{xhhSettlementProductInfoBean.isView()}"/>
                        <p:commandButton value="保存" icon="fa fa-save"
                                         action="#{xhhSettlementProductInfoBean.onSave()}"
                                         update="@form"
                                         rendered="#{xhhSettlementProductInfoBean.isAdd() || xhhSettlementProductInfoBean.isEdit()}"/>
                        <p:commandButton icon="fa fa-reply-all" value="返回"
                                         action="#{xhhSettlementProductInfoBean.onReturn(currentUserBean.back)}"
                                         process="@this"/>
                    </f:facet>
                </p:toolbar>
            </div>
            <div class="ui-g ui-fluid" style="padding-top: 30px;">
                <div class="ui-g-12 ">
                    <div class="ui-g-12 card">
                        <h1>基础信息</h1>
                        <p:panelGrid columns="4" layout="grid"
                                     columnClasses="ui-grid-col-1,ui-grid-col-5,ui-grid-col-1,ui-grid-col-5"
                                     styleClass="ui-panelgrid-blank"
                                     style="border:0px none; background-color:transparent;text-align:left;">
                            <p:outputLabel value="产品名称"/>
                            <p:inputText id="productName" value="#{xhhSettlementProductInfoBean.$.productName}"
                                         disabled="#{xhhSettlementProductInfoBean.isView()}"/>

                            <p:outputLabel value="合作模式"/>
                            <p:selectOneMenu id="copMode" value="#{xhhSettlementProductInfoBean.$.copMode}"
                                             disabled="#{xhhSettlementProductInfoBean.isView()}">
                                <p:ajax event="change" listener="#{xhhSettlementProductInfoBean.onChangeCopMode()}"
                                        process="@this"
                                        update="pricePanel"/>
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{xhhSettlementProductInfoBean.dictionaries[DictionaryCode.XHH_COOPERATION_MODE]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="主体名称"/>
                            <p:selectOneMenu value="#{xhhSettlementProductInfoBean.$.companyId}"
                                             filter="true" updateLabel="true"
                                             filterMatchMode="contains" required="true"
                                             requiredMessage="不能为空，请选择或输入"
                                             disabled="#{xhhSettlementProductInfoBean.isView()}">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems value="#{xhhSettlementProductInfoBean.companyGroup}"
                                               var="dic"
                                               itemLabel="#{dic.companyName}" itemValue="#{dic.id}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="结算方式"/>
                            <p:selectOneMenu id="settlementMode" value="#{xhhSettlementProductInfoBean.$.settlementMode}"
                                             disabled="#{xhhSettlementProductInfoBean.isView()}">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{xhhSettlementProductInfoBean.dictionaries[DictionaryCode.XHH_SETTLEMENT_CYCLE]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="收入类型"/>
                            <p:selectOneMenu id="incomeType" value="#{xhhSettlementProductInfoBean.$.incomeType}"
                                             disabled="#{xhhSettlementProductInfoBean.isView()}">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{xhhSettlementProductInfoBean.dictionaries[DictionaryCode.XHH_SETTLEMENT_INCOME_TYPE]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>
                        </p:panelGrid>
                        <p:outputPanel id="pricePanel">
                            <p:panelGrid columns="4" layout="grid"
                                         columnClasses="ui-grid-col-2,ui-grid-col-4,ui-grid-col-2,ui-grid-col-4"
                                         styleClass="ui-panelgrid-blank"
                                         style="border:0px none; background-color:transparent;text-align:left;">
                                <p:outputPanel rendered="#{xhhSettlementProductInfoBean.$.copMode==0
                                    || xhhSettlementProductInfoBean.$.copMode==2
                                    || xhhSettlementProductInfoBean.$.copMode==3
                                    || xhhSettlementProductInfoBean.$.copMode==4}">
                                    <p:outputLabel value="结算价格(元)"/>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementProductInfoBean.$.copMode==0
                                    || xhhSettlementProductInfoBean.$.copMode==2
                                    || xhhSettlementProductInfoBean.$.copMode==3
                                    || xhhSettlementProductInfoBean.$.copMode==4}">
                                    <p:inputNumber id="priceCpa" value="#{xhhSettlementProductInfoBean.$.priceCpa}"
                                                   disabled="#{xhhSettlementProductInfoBean.isView()}">
                                    </p:inputNumber>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementProductInfoBean.$.copMode==1
                                          || xhhSettlementProductInfoBean.$.copMode==3}">
                                    <p:outputLabel value="结算价格(%)"/>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementProductInfoBean.$.copMode==1
                                          || xhhSettlementProductInfoBean.$.copMode==3}">
                                    <p:inputText id="priceCps" value="#{xhhSettlementProductInfoBean.$.priceCps}"
                                                 disabled="#{xhhSettlementProductInfoBean.isView()}">
                                        <f:convertNumber pattern="#0.00"/>
                                    </p:inputText>
                                </p:outputPanel>
                            </p:panelGrid>
                        </p:outputPanel>

                        <p:panelGrid columns="2" layout="grid"
                                     columnClasses="ui-grid-col-1,ui-grid-col-11"
                                     styleClass="ui-panelgrid-blank"
                                     style="border:0px none; background-color:transparent;text-align:left;">
                            <p:outputLabel for="selectActivity" value="关联活动"/>
                            <p:selectCheckboxMenu id="selectActivity"
                                                  value="#{xhhSettlementProductInfoBean.activityIdList}"
                                                  updateLabel="true" multiple="true" filter="true"
                                                  filterMatchMode="contains"
                                                  disabled="#{xhhSettlementProductInfoBean.isView()}">
                                <f:selectItems value="#{xhhSettlementProductInfoBean.activityList}" var="activity"
                                               itemValue="#{activity.id}"
                                               itemLabel="#{activity.name}(#{activity.id})"/>
                            </p:selectCheckboxMenu>

                            <p:outputLabel for="selectActivity" value="备注"/>
                            <p:inputText id="remark" value="#{xhhSettlementProductInfoBean.$.remark}"
                                         disabled="#{xhhSettlementProductInfoBean.isView()}"/>
                        </p:panelGrid>
                    </div>

                    <p:outputPanel styleClass="ui-g-12 padding0"
                                   rendered="#{xhhSettlementProductInfoBean.incomeRequest.productId != null}">

                        <div class="ui-g-12 card">
                            <div style="background: -webkit-linear-gradient(top,#f6f7f9 0,#ebedf0 100%);margin-bottom: 10px">
                                <p:toolbar>
                                    <f:facet name="left">
                                        <p:commandButton id="toggler" type="button" value="展示选择"
                                                         style="width: auto;"
                                                         icon="ui-icon-calculator"/>
                                        <p:columnToggler datasource="statisticRecordDataTable" trigger="toggler"/>
                                    </f:facet>
                                    <f:facet name="right">
                                        <p:commandButton value="新增"
                                                         actionListener="#{xhhSettlementIncomeListBean.onAdd(xhhSettlementProductInfoBean.$.id)}"
                                                         oncomplete="PF('adding').show();" process="@this"
                                                         update="@form"
                                                         icon="fa fa-plus">
                                        </p:commandButton>
                                        <p:commandButton id="search" value="查询" icon="fa fa-search"
                                                         update="statisticRecordDataTable" ajax="true"/>
                                        <p:commandButton value="重置"
                                                         actionListener="#{xhhSettlementProductInfoBean.onReset()}"
                                                         icon="fa fa-refresh"
                                                         process="@this" update="@form"/>
                                        <p:commandButton value="导出" icon="fa fa-download"
                                                         ajax="false">
                                            <p:dataExporter type="xls" target="statisticRecordDataTable"
                                                            postProcessor="#{xhhSettlementProductInfoBean.postProcessXLS}"
                                                            fileName="#{xhhSettlementProductInfoBean.$.productName}-消耗记录"/>
                                        </p:commandButton>
                                    </f:facet>
                                </p:toolbar>
                            </div>
                            <h1>查询条件</h1>
                            <p:panelGrid columns="4" layout="grid"
                                         columnClasses="ui-grid-col-1,ui-grid-col-5,ui-grid-col-1,ui-grid-col-5"
                                         styleClass="ui-panelgrid-blank"
                                         style="border:0px none; background-color:transparent;text-align:center;margin-bottom:10px;">
                                <p:outputLabel value="结算时间"/>
                                <p:outputPanel>
                                    <p:calendar
                                            id="startTime" styleClass="autoWidthCalendar"
                                            value="#{xhhSettlementProductInfoBean.incomeRequest.startTime}"
                                            locale="#{constants:get('LOCALE')}"
                                            timeZone="#{constants:get('TIME_ZONE')}"
                                            pattern="#{constants:get('DATE_FORMAT')}"/>
                                    <span>— </span>
                                    <p:calendar
                                            id="endTime" styleClass="autoWidthCalendar"
                                            value="#{xhhSettlementProductInfoBean.incomeRequest.endTime}"
                                            locale="#{constants:get('LOCALE')}"
                                            timeZone="#{constants:get('TIME_ZONE')}"
                                            pattern="#{constants:get('DATE_FORMAT')}"/>
                                </p:outputPanel>
                            </p:panelGrid>
                            <p:dataTable id="statisticRecordDataTable"
                                         style="width: 100%;text-align:center"
                                         var="record"
                                         value="#{xhhSettlementProductInfoBean.incomeResponseLazyDataModel}"
                                         rows="#{constants:get('ROWS')}"
                                         lazy="true"
                                         paginator="true"
                                         paginatorTemplate="#{constants:get('PAGINATOR_TEMPLATE')}"
                                         rowsPerPageTemplate="#{constants:get('ROWS_PER_PAGE_TEMPLATE')}"
                                         emptyMessage="#{constants:get('EMPTY_MESSAGE')}"
                                         scrollable="true"
                                         scrollWidth="98%"
                                         reflow="true"
                                         selection=""
                                         resizableColumns="true">
                                <p:column headerText="开始时间" style="text-align:center;width: 70px">
                                    <h:outputText value="#{record.startTime}">
                                        <f:convertDateTime pattern="#{constants:get('DATE_FORMAT')}"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="结束时间" style="text-align:center;width: 70px">
                                    <h:outputText value="#{record.endTime}">
                                        <f:convertDateTime pattern="#{constants:get('DATE_FORMAT')}"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="产品名称" style="width: 100px">
                                    <h:outputText value="#{record.productName}"/>
                                </p:column>
                                <p:column headerText="主体唯一id" style="width: 50px">
                                    <h:outputText value="#{record.companyId}"/>
                                </p:column>
                                <p:column headerText="所属主体" style="width: 100px">
                                    <h:outputText value="#{record.companyName}"/>
                                </p:column>
                                <p:column headerText="推广方式" style="text-align:center;width: 100px">
                                    <h:outputText
                                            value="#{xhhSettlementProductInfoBean.translate(DictionaryCode.XHH_SETTLEMENT_SPREAD_MODE,record.spreadMode)}"/>
                                </p:column>
                                <p:column headerText="推广渠道" style="text-align:center;width: 100px">
                                    <h:outputText
                                            value="#{xhhSettlementProductInfoBean.translate(DictionaryCode.XHH_SETTLEMENT_SPREAD_CHANNEL,record.spreadChannel)}"/>
                                </p:column>
                                <p:column headerText="合作模式" style="text-align:center;width: 100px">
                                    <h:outputText
                                            value="#{xhhSettlementProductInfoBean.translate(DictionaryCode.XHH_COOPERATION_MODE,record.copMode)}"/>
                                </p:column>
                                <p:column headerText="结算方式" style="text-align:center;width: 100px">
                                    <h:outputText
                                            value="#{xhhSettlementProductInfoBean.translate(DictionaryCode.XHH_SETTLEMENT_CYCLE,record.settlementMode)}"/>
                                </p:column>

                                <p:column headerText="结算单价(元)" style="text-align:center;width: 100px">
                                    <h:outputText value="#{record.priceCpa == null ?'-':record.priceCpa}">
                                        <f:convertNumber pattern="#,##0.00"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="结算单价(%)" style="text-align:center;width: 100px">
                                    <h:outputText value="#{record.priceCps == null?'-':record.priceCps}">
                                        <f:convertNumber pattern="#,##0.00"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="注册数" style="text-align:center;width: 100px">
                                    <h:outputText value="#{record.registerCount == null ?'-': record.registerCount}"/>
                                </p:column>
                                <p:column headerText="放款金额" style="text-align:center;width: 100px">
                                    <h:outputText value="#{record.lendAmount == null ?'-': record.lendAmount}">
                                        <f:convertNumber pattern="#,##0.00"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="点击数" style="text-align:center;width: 100px">
                                    <h:outputText value="#{record.clickCount == null ?'-': record.clickCount}"/>
                                </p:column>
                                <p:column headerText="结算金额" style="text-align:center;width: 100px">
                                    <h:outputText value="#{record.incomeAmount}">
                                        <f:convertNumber pattern="#,##0.00"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="参与UV" style="text-align:center;width: 100px">
                                    <h:outputText value="#{record.participateUv}"/>
                                </p:column>
                                <p:column headerText="UV价值" style="text-align:center;width: 100px">
                                    <h:outputText value="#{record.uvValue}">
                                        <f:convertNumber pattern="#,##0.00"/>
                                    </h:outputText>
                                </p:column>
                                <p:column headerText="开票状态" style="text-align:center;width: 100px">
                                    <h:outputText value="未开票" rendered="#{record.billStatus==0}" style="color: red"/>
                                    <h:outputText value="财务专员审核中" rendered="#{record.billStatus==1}"
                                                  style="color: olivedrab"/>
                                    <h:outputText value="财务经理审核中" rendered="#{record.billStatus==2}"
                                                  style="color: olivedrab"/>
                                    <h:outputText value="已开票" rendered="#{record.billStatus==3}" style="color: blue"/>
                                </p:column>
                                <p:column headerText="创建人" style="text-align:center;width: 100px">
                                    <h:outputText value="#{record.creator}"/>
                                </p:column>
                                <p:column headerText="创建时间" style="text-align:center;width: 150px">
                                    <h:outputText value="#{record.createTime}">
                                        <f:convertDateTime pattern="#{constants:get('DATETIME_FORMAT')}"/>
                                    </h:outputText>
                                </p:column>
                            </p:dataTable>
                        </div>

                    </p:outputPanel>

                </div>
            </div>
            <p:dialog header="#{xhhSettlementIncomeListBean.header}" widgetVar="adding" modal="true" closable="true"
                      resizable="true" style="position: absolute;">
                <p:outputPanel id="add-dialog">
                    <div class="ui-g-12 ui-fluid" style="width:1000px;">
                        <p:panelGrid columns="4" layout="grid"
                                     columnClasses="ui-grid-col-1,ui-grid-col-5,ui-grid-col-1,ui-grid-col-5"
                                     styleClass="ui-panelgrid-blank"
                                     style="border:0px none; background-color:transparent;text-align:left;">
                            <p:outputLabel value="产品名称"/>
                            <p:selectOneMenu value="#{xhhSettlementIncomeListBean.settlementIncome.productId}"
                                             filter="true" updateLabel="true"
                                             filterMatchMode="contains">
                                <p:ajax event="change" listener="#{xhhSettlementIncomeListBean.onSelectProduct()}"
                                        process="@this" update="add-dialog"/>
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems value="#{xhhSettlementIncomeListBean.productList}"
                                               var="dic"
                                               itemLabel="#{dic.productName}" itemValue="#{dic.id}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="主体名称"/>
                            <p:selectOneMenu value="#{xhhSettlementIncomeListBean.settlementIncome.companyId}"
                                             filter="true" updateLabel="true"
                                             filterMatchMode="contains">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems value="#{xhhSettlementIncomeListBean.companyList}"
                                               var="dic"
                                               itemLabel="#{dic.companyName}" itemValue="#{dic.id}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="合作模式"/>
                            <p:selectOneMenu value="#{xhhSettlementIncomeListBean.settlementIncome.copMode}">
                                <p:ajax event="change" listener="#{xhhSettlementIncomeListBean.onChangeCopMode()}"
                                        process="add-dialog"
                                        update="add-dialog"/>
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{xhhSettlementIncomeListBean.dictionaries[DictionaryCode.XHH_COOPERATION_MODE]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="结算模式"/>
                            <p:selectOneMenu value="#{xhhSettlementIncomeListBean.settlementIncome.settlementMode}">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{xhhSettlementIncomeListBean.dictionaries[DictionaryCode.XHH_SETTLEMENT_CYCLE]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="收入类型"/>
                            <p:selectOneMenu value="#{xhhSettlementIncomeListBean.settlementIncome.incomeType}">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{xhhSettlementIncomeListBean.dictionaries[DictionaryCode.XHH_SETTLEMENT_INCOME_TYPE]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>
                        </p:panelGrid>

                        <p:outputPanel>
                            <p:panelGrid columns="4" layout="grid"
                                         columnClasses="ui-grid-col-2,ui-grid-col-4,ui-grid-col-2,ui-grid-col-4"
                                         styleClass="ui-panelgrid-blank"
                                         style="border:0px none; background-color:transparent;text-align:left;">
                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==0
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==2
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==3}">
                                    <p:outputLabel value="结算价格(元)"/>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==0
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==2
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==3}">
                                    <p:inputNumber value="#{xhhSettlementIncomeListBean.settlementIncome.priceCpa}">
                                        <p:ajax listener="#{xhhSettlementIncomeListBean.onChangeIncomeAmount()}"
                                                event="keyup"
                                                update="incomeAmount"/>
                                    </p:inputNumber>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==1
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==3}">
                                    <p:outputLabel value="结算价格(%)"/>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==1
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==3}">
                                    <p:inputText value="#{xhhSettlementIncomeListBean.settlementIncome.priceCps}">
                                        <p:ajax listener="#{xhhSettlementIncomeListBean.onChangeIncomeAmount()}"
                                                event="keyup"
                                                update="incomeAmount"/>
                                        <f:convertNumber pattern="#,##0.00"/>
                                    </p:inputText>
                                </p:outputPanel>
                            </p:panelGrid>
                        </p:outputPanel>


                        <p:panelGrid columns="4" layout="grid"
                                     columnClasses="ui-grid-col-1,ui-grid-col-5,ui-grid-col-1,ui-grid-col-5"
                                     styleClass="ui-panelgrid-blank"
                                     style="border:0px none; background-color:transparent;text-align:left;">

                            <p:outputLabel value="推广方式"/>
                            <p:selectOneMenu value="#{xhhSettlementIncomeListBean.settlementIncome.spreadMode}">
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{xhhSettlementIncomeListBean.dictionaries[DictionaryCode.XHH_SETTLEMENT_SPREAD_MODE]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="推广渠道"/>
                            <p:selectOneMenu value="#{xhhSettlementIncomeListBean.settlementIncome.spreadChannel}">
                                <p:ajax event="change" listener="#{xhhSettlementIncomeListBean.onChangeSpreadChannel()}"
                                        process="@this" update="add-dialog"/>
                                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                                              noSelectionOption="true"/>
                                <f:selectItems
                                        value="#{xhhSettlementIncomeListBean.dictionaries[DictionaryCode.XHH_SETTLEMENT_SPREAD_CHANNEL]}"
                                        var="dic"
                                        itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
                            </p:selectOneMenu>

                            <p:outputLabel value="开始日期"/>
                            <p:calendar
                                    value="#{xhhSettlementIncomeListBean.settlementIncome.startTime}"
                                    locale="#{constants:get('LOCALE')}"
                                    timeZone="#{constants:get('TIME_ZONE')}"
                                    pattern="#{constants:get('DATE_FORMAT')}">
                                <p:ajax event="dateSelect"
                                        listener="#{xhhSettlementIncomeListBean.onChangeParticipateUv()}" process="@this"/>
                            </p:calendar>

                            <p:outputLabel value="结束日期"/>
                            <p:calendar
                                    value="#{xhhSettlementIncomeListBean.settlementIncome.endTime}"
                                    locale="#{constants:get('LOCALE')}"
                                    timeZone="#{constants:get('TIME_ZONE')}"
                                    pattern="#{constants:get('DATE_FORMAT')}">
                                <p:ajax event="dateSelect"
                                        listener="#{xhhSettlementIncomeListBean.onChangeParticipateUv()}" process="@this"/>
                            </p:calendar>

                            <p:outputLabel value="结算金额"/>
                            <p:inputNumber id="incomeAmount"
                                           value="#{xhhSettlementIncomeListBean.settlementIncome.incomeAmount}">
                            </p:inputNumber>
                        </p:panelGrid>

                        <p:outputPanel>
                            <p:panelGrid columns="4" layout="grid"
                                         columnClasses="ui-grid-col-1,ui-grid-col-5,ui-grid-col-1,ui-grid-col-5"
                                         styleClass="ui-panelgrid-blank"
                                         style="border:0px none; background-color:transparent;text-align:left;">

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==0
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==3}">
                                    <p:outputLabel value="注册数"/>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==0
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==3}">
                                    <p:inputText value="#{xhhSettlementIncomeListBean.settlementIncome.registerCount}">
                                        <p:ajax listener="#{xhhSettlementIncomeListBean.onChangeIncomeAmount()}"
                                                event="keyup"
                                                update="incomeAmount"/>
                                    </p:inputText>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==1
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==3}">
                                    <p:outputLabel value="放款金额"/>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==1
                                    || xhhSettlementIncomeListBean.settlementIncome.copMode==3}">
                                    <p:inputNumber value="#{xhhSettlementIncomeListBean.settlementIncome.lendAmount}">
                                        <p:ajax listener="#{xhhSettlementIncomeListBean.onChangeIncomeAmount()}"
                                                event="keyup"
                                                update="incomeAmount"/>
                                    </p:inputNumber>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==2}">
                                    <p:outputLabel value="点击数"/>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.settlementIncome.copMode==2}">
                                    <p:inputText value="#{xhhSettlementIncomeListBean.settlementIncome.clickCount}">
                                        <p:ajax listener="#{xhhSettlementIncomeListBean.onChangeIncomeAmount()}"
                                                event="keyup"
                                                update="incomeAmount"/>
                                    </p:inputText>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.isSpecialChannel}">
                                    <p:outputLabel value="UV价值"/>
                                </p:outputPanel>

                                <p:outputPanel rendered="#{xhhSettlementIncomeListBean.isSpecialChannel}">
                                    <p:inputNumber value="#{xhhSettlementIncomeListBean.settlementIncome.uvValue}"/>
                                </p:outputPanel>
                            </p:panelGrid>
                        </p:outputPanel>

                        <p:panelGrid columns="2" layout="grid"
                                     columnClasses="ui-grid-col-1,ui-grid-col-11"
                                     styleClass="ui-panelgrid-blank"
                                     style="border:0px none; background-color:transparent;text-align:left;">
                            <p:outputPanel rendered="#{!xhhSettlementIncomeListBean.isSpecialChannel}">
                                <p:outputLabel for="selectActivity1" value="关联活动"/>
                            </p:outputPanel>

                            <p:outputPanel rendered="#{!xhhSettlementIncomeListBean.isSpecialChannel}">
                                <p:selectCheckboxMenu id="selectActivity1"
                                                      value="#{xhhSettlementIncomeListBean.activityIdList}"
                                                      updateLabel="true" multiple="true" filter="true"
                                                      filterMatchMode="contains">
                                    <f:selectItems value="#{xhhSettlementIncomeListBean.activityList}" var="activity"
                                                   itemValue="#{activity.id}"
                                                   itemLabel="#{activity.name}(#{activity.id})"/>
                                </p:selectCheckboxMenu>
                            </p:outputPanel>

                            <p:outputLabel for="selectActivity" value="备注"/>
                            <p:inputText value="#{xhhSettlementIncomeListBean.settlementIncome.remark}"/>
                        </p:panelGrid>

                        <p:commandButton value="保存" style="float: right"
                                         actionListener="#{xhhSettlementIncomeListBean.onSave()}"
                                         process="@this add-dialog"
                                         rendered="#{xhhSettlementIncomeListBean.settlementIncome.billId==null}"/>
                    </div>
                </p:outputPanel>
            </p:dialog>
        </h:form>
    </ui:define>
</ui:composition>